package com.galeno.test;

import org.apache.commons.lang3.time.DateUtils;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

/**
 * @author galeno
 * @Title:
 * @Description:
 * @date 日期2021/11/16时间10:27
 */
public class TimeBound {
    public static void main(String[] args) {
        SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd:HH:mm:ss");
        //向上取整
        Date ceiling = DateUtils.ceiling(new Date(System.currentTimeMillis()), Calendar.HOUR);
        long time = ceiling.getTime();
        String format = sdf.format(time);
        System.out.println(format);


    }
}
